import pygame,  Utilities
from pygame.locals import *
from Utilities import *

class Explosion(pygame.sprite.Sprite):
    images = []
    def __init__(self, actor,  explosion_images):
        pygame.sprite.Sprite.__init__(self)
        self.images = explosion_images
        self.image = self.images[1]
        self.rect = self.image.get_rect(center=actor.rect.center)
        self.life = 1

    def update(self):
        if self.life >= 16: 
            self.kill()
        else:
            self.life = self.life + 1
            self.image = self.images[self.life]
